package com.sha.mumbailocal.server.model;

import java.util.List;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.Order;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.sha.mumbailocal.server.model.intf.IPersistentObject;

@PersistenceCapable
public class Train implements IPersistentObject {
	@PrimaryKey
	@Persistent
	private String number;

	@Persistent
	private String name;

	@Persistent
	private Key startStation;

	@Persistent
	private Key endStation;

	@Persistent
	private String apiNumber;

	@Persistent(mappedBy = "train")
	@Order(extensions = @Extension(vendorName = "datanucleus", value = "arrival asc", key = "list-ordering"))
	private List<TrainStop> stops;

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Key getStartStation() {
		return startStation;
	}

	public void setStartStation(Key startStation) {
		this.startStation = startStation;
	}

	public Key getEndStation() {
		return endStation;
	}

	public void setEndStation(Key endStation) {
		this.endStation = endStation;
	}

	public String getApiNumber() {
		return apiNumber;
	}

	public void setApiNumber(String apiNumber) {
		this.apiNumber = apiNumber;
	}

	public List<TrainStop> getStops() {
		return stops;
	}

	public void setStops(List<TrainStop> stops) {
		this.stops = stops;
	}

}
